function []=chapter6_2run()

[en,cd,u]=PoissonDirichletFEM(100,@f1,@g1);
err =0;
for i =1:length(en)
    x = (cd(1,en(1,i))+cd(1,en(2,i))+cd(1,en(3,i)))/3;
    y = (cd(2,en(1,i))+cd(2,en(2,i))+cd(2,en(3,i)))/3;
    r = (u(en(1,i))+u(en(2,i))+u(en(3,i)))/3;
    e = abs(g1(x,y)-r);
    if e>err
        err =e;
    end    
end
err
'press anykey to continue'
pause
[en,cd,u]=PoissonNeumannFEM(50,@f1,@h1);
for i =1:length(en)
    x = (cd(1,en(1,i))+cd(1,en(2,i))+cd(1,en(3,i)))/3;
    y = (cd(2,en(1,i))+cd(2,en(2,i))+cd(2,en(3,i)))/3;
    r = (u(en(1,i))+u(en(2,i))+u(en(3,i)))/3;
    e = abs(g1(x,y)-r);
    if e>err
        err =e;
    end    
end
err

end